<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="org.springside.modules.security.domain">
    <class name="Permission" table="system_perms" dynamic-insert="true" dynamic-update="true">
		<id name="id" type="integer">
			<column name="id" />
			<generator class="native" />
		</id>
		<property name="name" type="string">
			<column name="name" length="50" not-null="true" />
		</property>
		<property name="descn" type="string">
			<column name="descn" />
		</property>
		<property name="operation" type="string">
			<column name="operation" length="50" />
		</property>
		<property name="status" type="string">
			<column name="status" length="2" />
		</property>
		<property name="path" type="string">
			<column name="path" length="50" />
		</property>
		<property name="menus" type="string">
			<column name="menus" length="500" />
		</property>		
		<property name="operationHK" type="string">
			<column name="operation_HK" length="50" />
		</property>
		<property name="operationUS" type="string">
			<column name="operation_US" length="50" />
		</property>		
        <set name="roles" table="system_role_perm" lazy="true" inverse="true" cascade="save-update" batch-size="5">
            <key>
                <column name="perm_id" not-null="true"/>
            </key>
            <many-to-many class="Role" column="role_id" outer-join="auto"/>
        </set>
        <set name="resources" table="system_perm_resc" lazy="true" inverse="false" cascade="save-update" batch-size="5">
            <key>
                <column name="perm_id" not-null="true"/>
            </key>
            <many-to-many class="Resource" column="resc_id"/>
        </set>
    </class>
</hibernate-mapping>
